﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TestApi.Models;
using TestApi.Services;
namespace TestApi.Profiles
{
    public class TestMapper:Profile
    {
        public TestMapper()
        {
            CreateMap<GithubDto, Left>()
                  .ForMember(d => d.Description, opt => opt.MapFrom(s => s.description))
                  .ForMember(d => d.Name, opt => opt.MapFrom(s => s.name))
                  .ForMember(d => d.HtmlUrl, opt => opt.MapFrom(s => s.html_url));  

            CreateMap<Left, LeftDto>();
            CreateMap<RightDto, Right>() 
                  ;
            CreateMap<LeftDto, Right>()
                    .ForMember(d => d.LeftId, opt => opt.MapFrom(s => s.Id));
        }
    }
}
